$ = Ext;
$.version = 1;
$.ns('$.dd');

String.prototype.ltrim = function(char){
	char = char || '\\s';
	return this.replace(new RegExp('^[' + char + ']+', 'g'), '');
}

String.prototype.rtrim = function(char){
	char = char || '\\s';
	return this.replace(new RegExp('[' + char + ']+$', 'g'), '');
}

String.prototype.trim = function(char){
	char = char || '\\s';
	return this.ltrim(this.rtrim(char), char);
}

String.prototype.trimAll = function(char){
	char = char || '\\s';
	return this.trim(char).replace(/\s+/g, ' ');	
}